import { createRouter ,createWebHashHistory } from 'vue-router';

// 路由数组
const routes=[
  {
    path: '/',              // 重定向到首页
    redirect:'/index'
  },
  {
    path: '/index',         // 首页
    name: 'index',
    component: () => import('../views/index/index.vue')
  },
  {
    path: '/community',     // 社区
    name: 'community',
    component: () => import('../views/community/index.vue')
  },
  {
    path: '/welfare',     // 福利
    name: 'welfare',
    component: () => import('../views/welfare/index.vue')
  },
  {
    path: '/my',         // 我的
    name: 'my',
    component: () => import('../views/my/index.vue')
  }
]

// 创建路由
const router = createRouter ({
  history:createWebHashHistory(),
  routes,
  mode: "history",   //hash       去掉路由地址中#
  linkActiveClass:'selected'
})

export default router
 